WithExecutionMode(TSource) Method

Task Parallel System.Threading

Sets the execution mode of the query.

Namespace:  System.Linq
Assembly:  System.Threading (in System.Threading.dll)

Syntax

Visual Basic (Declaration)
Public Shared Function WithExecutionMode(Of TSource) ( _
	source As ParallelQuery(Of TSource), _
	executionMode As ParallelExecutionMode _
) As ParallelQuery(Of TSource)
C#
public static ParallelQuery<TSource> WithExecutionMode<TSource>(
	ParallelQuery<TSource> source,
	ParallelExecutionMode executionMode
)

Parameters

source
Type: System.Linq..::.ParallelQuery<(Of <(TSource>)>)
A ParallelQuery on which to set the option.
executionMode
Type: System.Linq..::.ParallelExecutionMode
The mode in which to execute the query.

Type Parameters

TSource
The type of elements of source.

Return Value

ParallelQuery representing the same query as source, but with the registered.

Exceptions

ExceptionCondition
System..::.ArgumentNullException source is a null reference (Nothing in Visual Basic).
System..::.ArgumentException executionMode is not a valid ParallelExecutionMode value.
System..::.InvalidOperationException WithExecutionMode is used multiple times in the query.

See Also